import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_native_plugin/flutter_native_plugin.dart';
import 'package:flutter_native_plugin/flutter_native_plugin_platform_interface.dart';
import 'package:flutter_native_plugin/flutter_native_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterNativePluginPlatform
    with MockPlatformInterfaceMixin
    implements FlutterNativePluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterNativePluginPlatform initialPlatform = FlutterNativePluginPlatform.instance;

  test('$MethodChannelFlutterNativePlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterNativePlugin>());
  });

  test('getPlatformVersion', () async {
    FlutterNativePlugin flutterNativePlugin = FlutterNativePlugin();
    MockFlutterNativePluginPlatform fakePlatform = MockFlutterNativePluginPlatform();
    FlutterNativePluginPlatform.instance = fakePlatform;

    expect(await flutterNativePlugin.getPlatformVersion(), '42');
  });
}
